//
//  TPSGroupUserCell.m
//  TPSLIVE
//
//  Created by 贺森 on 2017/11/17.
//  Copyright © 2017年 HS. All rights reserved.
//

#import "TPSGroupUserCell.h"
#import "TIMDemoMacro.h"
#import "UIView+Extension.h"

@implementation TPSGroupUserCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self init_TPSGroupUserCell];
    }
    return self;
}

- (void)init_TPSGroupUserCell {
    self.avatarImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 45, 45)];
    self.avatarImgView.backgroundColor = UIColor.whiteColor;
    self.avatarImgView.layer.cornerRadius = self.avatarImgView.height/2;
    self.avatarImgView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.avatarImgView];
    
    self.userName = [[UILabel alloc] initWithFrame:CGRectMake(0, self.avatarImgView.height, 45, 20)];
    self.userName.backgroundColor = UIColor.whiteColor;
    self.userName.font = TPSFontSize(12);
    self.userName.textColor = RGBColor(51, 51, 51);
    self.userName.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.userName];
}

- (void)setUser:(TIMUserInfo *)user {
    _user = user;
//    [self.avatarImgView sd_setImageWithURL:[user.avatarURL filterChineseAndThin] placeholderImage:kLOADIMAGE(@"userNorm_image")];
    [self.avatarImgView setImage:[UIImage imageNamed:@"userNorm_image"]];
    self.userName.text = user.showName;
}
@end
